<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<script type="text/javascript">

// name space for this page
var p01_cworder_modify = {
    mid: "${menuId}",
    focusId: "p01_cworder_modify_mobile"
};

// modify panel
p01_cworder_modify.modifyPanel = Ext.create("Ext.form.Panel", {
    region: "center",
    frame: true,
    bodyPadding: 5,
    defaults: {
        xtype: "fieldset",
        layout: "anchor",
        defaults: {
            xtype: "container",
            anchor: "100%",
            layout: "hbox",
            defaultType: "textfield",
            padding: "2 0",
            defaults: {
                labelAlign: "left",
                labelWidth: 100,
                width: 240,
                labelStyle: "padding-left: 15px"
            }
        }
    },
    items: [{
        title: "联系人信息",
        items: [{
        	items: [{
        		xtype : "hiddenfield",
                name : "order_id",
                value : "${order_id}"
        	}]
        },{
            items: [{
                id: "p01_cworder_modify_mobile",
                fieldLabel: "手机号码",
                value: "${mobile}",
                name: "mobile",
                allowBlank: false
            }, {
                fieldLabel: "车牌号码",
                name: "car_id",
                value: "${car_id}",
                allowBlank: false
            }, {
                xtype: "hidden",
                name: "car_size_type"
            }]
        }, {
            items: [{
                fieldLabel: "姓名",
                name: "name",
                value: "${name}",
                allowBlank: false
            }, {
                xtype: "fieldcontainer",
                fieldLabel: "性别",
                value: "${gender}",
                defaultType: "radiofield",
                defaults: {
                    flex: 1
                },
                layout: "hbox",
                items: [{
                    boxLabel: "男",
                    name: "gender",
                    // checked: true,
                    inputValue: "1"
                }, {
                    boxLabel: "女",
                    name: "gender",
                    inputValue: "2"
                }]
            }]
        }, {
            items: [{
                fieldLabel: "联系电话一",
                value: "${phone1}",
                name: "phone1"
            }, {
                fieldLabel: "联系电话二",
                value: "${phone2}",
                name: "phone2"
            }]
        }]
    }, {
        title: "预约信息",
        items: [{
            items: [{
                xtype: "datefield",
                format: "Y-m-d",
                fieldLabel: "日期",
                name: "order_date",
                emptyText: "服务日期",
                value: "${order_date}",
                editable: false,
                allowBlank: false
            }, {
                xtype: "timefield",
                name: "time_st",
                labelStyle: "padding-left: 10px",
                labelWidth: 30,
                margin: "0 0 0 10",
                minValue: "8:30",
                maxValue: "17:00",
                format: "G:i",
                fieldLabel: "从",
                emptyText: "最早",
                width: 145,
                editable: false,
                allowBlank: false
            }, {
                xtype: "timefield",
                name: "time_end",
                labelWidth: 30,
                labelStyle: "padding-left: 10px",
                fieldLabel: "到",
                emptyText: "最晚",
                minValue: "9:00",
                maxValue: "17:30",
                format: "G:i",
                width: 145,
                editable: false,
                allowBlank: false
            }]
        }, {
            items: [{
                fieldLabel: "地址",
                name: "addr",
                value: "${addr}",
                width: 600
            }]
        }]
    }, {
        title: "套餐及费用",
        items: [{
            items: [{
                fieldLabel: "套餐",
                value: "${svc_package}",
                name: "svc_package"
            }, {
                fieldLabel: "费用",
                value: "${total_fee}",
                name: "total_fee"
            }]
        }]
    }, {
        xtype: "container",
        frame: true,
        layout: "anchor",
        margin: "10 0",
        items: [{
            xtype: "container",
            defaults: {
                xtype: "button",
                style: "margin-right: 5px; padding: 2px 20px"
            },
            items: [{
                text: "重置",
                handler: function() {
                    this.up("form").getForm().reset();
                    Ext.getCmp(p01_cworder_modify.focusId).focus();
                }
            }, {
                text: "保存",
                handler: function() {
                    this.up("form").getForm().submit({
                        url: "cworder/edit.shtm",
                        success: function(form, action) {
                            if (action.result.success == "true") {
                                Ext.Msg.alert("信息提示", "保存成功");
                            }
                        },
                        faliure: function(form, action) {
                            Ext.Msg.alert("提示信息", action.result.errorMsgs);
                        }
                    });
                }
            }]
        }]
    }]
});

// show tab content
p01_cworder_modify.items = [p01_cworder_modify.modifyPanel];
crm.utils.showTabContent(p01_cworder_modify);

</script>

